﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging;

namespace NET.Library.Errors.Logging
{
    /// <summary>
    /// Logger Wrapper for Microsoft.Practices.EnterpriseLibrary.Logging.Logger class.
    /// </summary>
    public static class Logger
    {
        #region Properties
        ///----------------------------------------------------------------------------------
        /// <summary>
        /// 
        /// </summary>
        ///----------------------------------------------------------------------------------
        public static Microsoft.Practices.EnterpriseLibrary.Logging.LogWriter Writer 
        {
            get
            {
                return Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Writer;
            }
        }
        #endregion

        #region Static Methods
        ///----------------------------------------------------------------------------------
        /// <summary>
        /// 
        /// </summary>
        /// <param name="message"></param>
        ///----------------------------------------------------------------------------------
        public static void Write(Object message)
        {
            Microsoft.Practices.EnterpriseLibrary.Logging.Logger.Write(message);
        }

        ///----------------------------------------------------------------------------------
        /// <summary>
        /// 
        /// </summary>
        /// <param name="log"></param>
        /// <returns></returns>
        ///----------------------------------------------------------------------------------
        public static bool ShouldLog(Microsoft.Practices.EnterpriseLibrary.Logging.LogEntry log)
        {
            return Microsoft.Practices.EnterpriseLibrary.Logging.Logger.ShouldLog(log);
        }

        ///----------------------------------------------------------------------------------
        /// <summary>
        /// 
        /// </summary>
        ///----------------------------------------------------------------------------------
        public static void FlushContextItems()
        {
            Microsoft.Practices.EnterpriseLibrary.Logging.Logger.FlushContextItems();
        }

        ///----------------------------------------------------------------------------------
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        ///----------------------------------------------------------------------------------
        public static bool IsLoggingEnabled()
        {
            return Microsoft.Practices.EnterpriseLibrary.Logging.Logger.IsLoggingEnabled();
        }

        ///----------------------------------------------------------------------------------
        /// <summary>
        /// 
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        ///----------------------------------------------------------------------------------
        public static void SetContextItem(Object key, Object value)
        {
            Microsoft.Practices.EnterpriseLibrary.Logging.Logger.SetContextItem(key, value);
        }
        #endregion
    }
}
